#ifndef __SUBJECT_H__
#define __SUBJECT_H__

#include <string>
#include <vector>
#include <memory>

class Observer;
class Subject
{
public:
    Subject() = default;
    virtual ~Subject() = default;
    virtual void Attach(std::shared_ptr<Observer> obv);
    virtual void Detach(std::shared_ptr<Observer> obv);
    virtual void Notify();
    virtual void SetStatus(std::string &status) = 0;
    virtual std::string GetStatus() = 0;
private:
    std::vector<std::shared_ptr<Observer>> obvs_;
};

class SubjectA : public Subject
{
public:
    SubjectA() = default;
    ~SubjectA() = default;
    void SetStatus(std::string &status);
    std::string GetStatus();
private:
    std::string status_{};
};

class SubjectB : public Subject
{
public:
    SubjectB() = default;
    ~SubjectB() = default;
    void SetStatus(std::string &status);
    std::string GetStatus();
private:
    std::string status_{};
};

#endif

